<!-- 淘客报表 -->
<template>
  <div class="mainTable">
    <BaseTable :query="query" :tableItems="tableItems" :updateItems="updateItems" :optionList="optionList"
      :methodParam="methodParam" :Btn="Btn" :imgUrlPrefix="imgUrlPrefix" menuName="logRecord" pageName="mainTable" />
  </div>
</template>
<script>
import dayjs from "dayjs"
import { service } from "@/services/backServices"
import BaseTable from "../../table/tkbbTable.vue";
export default {
  name: "tkbb",
  data() {
    return {
      //后端人员修改-S
      //查询参数
      imgUrlPrefix: GlobalSetting.imgUrlPrefix + "data/img_dtk/",
      query: [
         { prop: "whetherSum", type: "select", placeholder: "", value: "否", name: "是否合计" },
         { prop: "unit", type: "select", placeholder: "", value: "日", name: "时间粒度" },

        // //英文名称需要改，最好可以遍历品牌名称
        { prop: "competingBrandName", type: "select", placeholder: "全部", value: "", name: "竞品品牌名" },

        // {
        //   prop: "searchTime", type: "time", placeholder: "",
        //   // value: GlobalSetting.fakeTime ?? [dayjs(new Date()).add(-1, 'days').format("YYYY-MM-DD"), dayjs(new Date()).format("YYYY-MM-DD")],
        //   value: ['2024-01-14', '2024-01-15'],
        //   name: "查询时间"
        // },

        {
          prop: "beginDate", type: "time", placeholder: "",
          // value: dayjs(new Date()).add(-3,"day").format("YYYY-MM-DD"),
          value: dayjs(new Date()).add(-3, "months").format("YYYY-MM-DD"),
          name: "开始时间"
        },
        {
          prop: "endDate", type: "time", placeholder: "",
          value: dayjs(new Date()).add(-1, "days").format("YYYY-MM-DD"),
          name: "结束时间"
        },


      ],
      //表格表头 参数名是中文
      tableItems: [
        // { name: "数据统计时间", prop: "数据统计时间", align: "left" },
        // { name: "竞品品牌名", prop: "竞品品牌名", align: "left" },
        // { name: "竞品店铺名称", prop: "竞品店铺名称", align: "left" },

        // // <el-link href="https://element.eleme.io" target="_blank">默认链接</el-link>
        // { name: "大淘客推广链接", prop: "大淘客推广链接", type: "url", align: "left" },
        // { name: "推广主图", prop: "推广主图", type: "img", sortable: false, align: "left" },
        // { name: "推广主图链接", prop: "推广主图链接", sortable: false, align: "left" },
        // { name: "优惠券金额", prop: "优惠券金额" },
        // { name: "商品券后价", prop: "商品券后价" },
        // { name: "佣金比例", prop: "佣金比例" },
        // { name: "微信推广文案", prop: "微信推广文案", sortable: false, align: "left" },
        // { name: "社群名称", prop: "社群名称", align: "left" },
        // { name: "推广商品链接", prop: "推广商品链接", sortable: false, align: "left" },
        // { name: "当日热销", prop: "当日热销" }
      ],

      // 


      //增删查改的对象属性
      updateItems: [//edit是回复
        { name: "文件名称", prop: "fileName", type: "input", disabled: true },
        { name: "上传类型", prop: "uploadType", type: "select" },
        { name: "备注", prop: "remark", type: "textarea" },
        { name: "上传文件", prop: "fileAdd", type: "upload" },
      ],
      //增删查改的对象属性的下拉select或者级联cascader
      optionList: {
        unit: [
          { label: "日", value: "日" },
          { label: "周", value: "周" },
          { label: "月", value: "月" },
          { label: "年", value: "年" },
        ],
        whetherSum: [
          { label: "是", value: "是" },
          { label: "否", value: "否" },
        ],
        competingBrandName: [
          // 需要改为接口调用的方式
          // { label: "自由点", value: "自由点" },
          // { label: "苏菲", value: "苏菲" },
          // { label: "高洁丝", value: "高洁丝" },
          // { label: "七度空间", value: "七度空间" },
          // { label: "她研社", value: "她研社" },
          // { label: "淘淘氧棉", value: "淘淘氧棉" },
          // { label: "薇尔", value: "薇尔" },
          // { label: "舒莱", value: "舒莱" },
          // { label: "凸凸棉", value: "凸凸棉" },
          // { label: "abc", value: "abc" },
          // { label: "倍舒特", value: "倍舒特" },
          // { label: "软风研究社", value: "软风研究社" },
          // { label: "洁婷", value: "洁婷" },
        ]
      },
      //增删查改方法参数
      methodParam: "dtkCompetingBrandPromotionDayStatExe",
      //自定义btn功能
      Btn: {
        search: true, //查询按钮
        add: false, //添加按钮
        edit: false, //回复按钮
        detail: false, //详情按钮
        delete: false, //删除按钮
        deletes: false, //批量删除按钮
        export: true, //导出按钮
        templateDownload: false, //模板下载按钮
        upload: false, //上传按钮
      },
      //后端人员修改-E
    };
  },
  components: {
    BaseTable
  },
  created() {
    let _this = this
    // service({
    //   method: "post",
    //   url: "getAllBrand"
    // }).then(res => {
    //   this.optionList.competingBrandName = res.data.data.map(v => {
    //     return { label: v, value: v }
    //   })
    //   console.log(this.optionList)
    // })
  }
};
</script>
<style scoped lang="less">
.mainTable {
  background-color: #f1f2f9;
}
</style>